package cn.yangliu.nacos.comm.oauth;

import cn.yangliu.nacos.comm.JsonResult;
import cn.yangliu.nacos.comm.enums.GlobalResultCode;
import cn.yangliu.nacos.comm.model.Oauth2InsertModel;
import cn.yangliu.nacos.comm.model.Oauth2Token;
import cn.yangliu.nacos.comm.model.Oauth2UpdateOtherModel;
import cn.yangliu.nacos.comm.model.Oauth2UpdateOtherPasswordModel;
import cn.yangliu.nacos.comm.model.Oauth2UpdatePasswordModel;
import cn.yangliu.nacos.comm.model.Oauth2UpdateSelfModel;
import cn.yangliu.nacos.comm.model.Oauth2UserModel;
import cn.yangliu.nacos.comm.model.Oauth2UserQueryModel;
import org.springframework.stereotype.Component;

/**
 * The type of nacos.
 *
 * @author 问道于盲
 * @date 2019 -12-31
 */
@Component
public class Oauth2FeignFallback implements Oauth2FeignClient {

    /**
     * Token json result.
     *
     * @param username     the username
     * @param password     the password
     * @param grantType    the grant type
     * @param clientId     the client id
     * @param clientSecret the client secret
     * @param code         the code
     * @param redirectUri  the redirect uri
     * @return the json result
     */
    @Override
    public JsonResult<Oauth2Token> token(String username, String password, String grantType, String clientId,
                                         String clientSecret, String code, String redirectUri) {
        return JsonResult.getInstance(GlobalResultCode.FAILD);
    }

    /**
     * Insert json result.
     *
     * @param model the model
     * @param token the token
     * @return the json result
     */
    @Override
    public JsonResult<Oauth2UserModel> insert(Oauth2InsertModel model, String token) {
        return JsonResult.getInstance(GlobalResultCode.FAILD);
    }

    /**
     * Update self json result.
     *
     * @param model the model
     * @param token the token
     * @return the json result
     */
    @Override
    public JsonResult<Oauth2UserModel> updateSelf(Oauth2UpdateSelfModel model, String token) {
        return JsonResult.getInstance(GlobalResultCode.FAILD);
    }

    /**
     * Update other json result.
     *
     * @param model the model
     * @param token the token
     * @return the json result
     */
    @Override
    public JsonResult<Oauth2UserModel> updateOther(Oauth2UpdateOtherModel model, String token) {
        return JsonResult.getInstance(GlobalResultCode.FAILD);
    }

    /**
     * Update self password json result.
     *
     * @param model the model
     * @param token the token
     * @return the json result
     */
    @Override
    public JsonResult<Boolean> updateSelfPassword(Oauth2UpdatePasswordModel model, String token) {
        return JsonResult.getInstance(GlobalResultCode.FAILD);
    }

    /**
     * Update other password json result.
     *
     * @param model the model
     * @param token the token
     * @return the json result
     */
    @Override
    public JsonResult<Boolean> updateOtherPassword(Oauth2UpdateOtherPasswordModel model, String token) {
        return JsonResult.getInstance(GlobalResultCode.FAILD);
    }

    /**
     * Principal json result.
     *
     * @param token the token
     * @return the json result
     */
    @Override
    public JsonResult<Oauth2UserModel> principal(String token) {
        return JsonResult.getInstance(GlobalResultCode.FAILD);
    }

    /**
     * Delete json result.
     *
     * @param id    the id
     * @param token the token
     * @return the json result
     */
    @Override
    public JsonResult<Boolean> delete(Long id, String token) {
        return JsonResult.getInstance(GlobalResultCode.FAILD);
    }

    /**
     * Find one json result.
     *
     * @param model the model
     * @param token the token
     * @return the json result
     */
    @Override
    public JsonResult<Oauth2UserModel> findOne(Oauth2UserQueryModel model, String token) {
        return JsonResult.getInstance(GlobalResultCode.FAILD);
    }

    /**
     * Check exist json result.
     *
     * @param model the model
     * @param token the token
     * @return the json result
     */
    @Override
    public JsonResult<Boolean> checkExist(Oauth2UserQueryModel model, String token) {
        return JsonResult.getInstance(GlobalResultCode.FAILD);
    }
}
